package com.fjnldx.mes.service.scheduling.alarm.rule.inspector.contrast;

import com.fjnldx.mes.domain.pojo.alarm.enums.TriggerConditionEnum;
import org.springframework.stereotype.Service;

/**
 * 大于对比
 */
@Service
public class GreaterContrast implements AlarmContrast {
    @Override
    public TriggerConditionEnum getCondition() {
        return TriggerConditionEnum.GREATER;
    }

    @Override
    public boolean Contrast(String value, String standardValues) {
        try {
            double currentValue = Double.parseDouble(value);
            double standardValue = Double.parseDouble(standardValues);
            return currentValue > standardValue;
        } catch (Exception e) {
            return false;
        }
    }
}
